package org.minos.edit.controller
{
	import org.aswing.Component;
	import org.aswing.JOptionPane;
	import org.minos.edit.Main;
	import org.minos.edit.model.vo.DialogVO;
	import org.minos.edit.view.EditMediator;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	/**
	 * ...
	 * @author Minos
	 */
	public class DialogCommand extends SimpleCommand
	{
		
		override public function execute( notification : INotification ) : void
		{
			super.execute( notification );
			
			var o : DialogVO = notification.getBody() as DialogVO;
			if ( !o )
				return;
			if (o.container == null)
				o.container = (facade.retrieveMediator( EditMediator.NAME ).getViewComponent() as Main).mainWindow;
				
			var jop : JOptionPane = JOptionPane.showMessageDialog( o.title , o.msg , o.callback , o.container , true , null , o.button );
		}
	
	}

}